home *** CD-ROM | disk | FTP | other *** search
- // Fill in borland library.
-
- #undef FillMemory
- void FillMemory( LPTSTR lpszBuffer, int Bytes, BYTE c )
- {
- memset( lpszBuffer, c, Bytes );
- }
-
- #undef ZeroMemory
- void ZeroMemory( LPTSTR lpszBuffer, int Bytes )
- {
- memset( lpszBuffer, 0, Bytes );
- }
-
- // Simple utility routine that shows progression.
- // This is used in most multithreaded synchronization programs.
-
- OutputString(HWND hWnd, LPSTR lpszOperation)
- {
- TCHAR szBuffer[512]; // work area for print formatting
- SYSTEMTIME st; // time here.
-
- static int row = 0;
- static int msg_num = 1;
- HDC hDC = GetDC( hWnd );
-
- GetLocalTime( &st );
- FillMemory( szBuffer, 100, 32 );
- TextOut( hDC, 0, row, szBuffer, 100 );
- // Message number and tick count are printed with message to help
- // illustrate the synchronization of activity.
- #if defined(OUTSTR_JUST_MESSAGE)
- wsprintf( szBuffer, "%s", lpszOperation );
- #elif defined(OUTSTR_SHOW_TIME)
- wsprintf( szBuffer, "At %2d:%2d:%2d:%3d -> %s",
- st.wHour, st.wMinute, st.wSecond, st.wMilliseconds,
- lpszOperation );
- #else // show message number
- wsprintf( szBuffer, "%3d: %s", msg_num++, lpszOperation );
- #endif
-
- TextOut( hDC, 0, row, szBuffer, lstrlen( szBuffer ) );
-
- if ( row > 200 )
- row = 0;
- else
- row += 20;
- ReleaseDC( hWnd, hDC );
- }
-